﻿using Business.BorrowManagement.Dto;
using Business.BorrowManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Business.RGoodManagement;
using Business.RGoodManagement.Dto;

namespace Business.Controllers
{

    [RemoteService]
    [Area("Business")]
    [Route("api/business/rgood")]
    public class RGoodController : AbpController
    {
        private readonly IRGoodAppService _RGoodAppService;

        public RGoodController(IRGoodAppService RGoodAppService)
        {
            _RGoodAppService = RGoodAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<RGoodDto> CreateOrUpdate(RGoodDto input)
        {
            return _RGoodAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _RGoodAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<RGoodDto> Get(Guid id)
        {
            return _RGoodAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<RGoodDto>> GetAll(GetRGoodInputDto input)
        {
            return _RGoodAppService.GetAll(input);
        }
    }
}
